from pandac.PandaModules import TextProperties, TextPropertiesManager

def TextPropertySet(propName, **args):
    tpAdd = TextProperties()
    for key,valueList in args.items():
        try:
           setter = getattr(tpAdd, "set%s"%(key))
           setter(*valueList)
        except: print "error"

    tpMgr = TextPropertiesManager.getGlobalPtr()
    tpMgr.setProperties(propName, tpAdd)

def TextColorSet(propName, colorTuple):
    tpAdd = TextProperties()
    tpAdd.setTextColor(*colorTuple)
    tpMgr = TextPropertiesManager.getGlobalPtr()
    tpMgr.setProperties(propName, tpAdd)
